package com.example.musicdemo;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * @类 MusicDemo
 * @作者: 吴金龙
 * @创建时间: 2022/2/25
 * @描述:
 */
public class Song implements Parcelable {

    private String title;//歌曲名称
    private String singer;//歌手
    private String image;//封面图片
    private String data;//存放路径

    public Song() {
        super();
    }

    public Song(String title, String singer, String image, String data) {
        this.title = title;
        this.singer = singer;
        this.image = image;
        this.data = data;
    }

    protected Song(Parcel in) {
        title = in.readString();
        singer = in.readString();
        image = in.readString();
        data = in.readString();
    }

    public static final Creator<Song> CREATOR = new Creator<Song>() {
        @Override
        public Song createFromParcel(Parcel in) {
            return new Song(in);
        }

        @Override
        public Song[] newArray(int size) {
            return new Song[size];
        }
    };

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getSinger() {
        return singer;
    }

    public void setSinger(String singer) {
        this.singer = singer;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public String getData() {
        return data;
    }

    public void setData(String data) {
        this.data = data;
    }

    @Override
    public String toString() {
        return "Song{" +
                "title='" + title + '\'' +
                ", singer='" + singer + '\'' +
                ", image='" + image + '\'' +
                ", data='" + data + '\'' +
                '}';
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeString(title);
        parcel.writeString(singer);
        parcel.writeString(image);
        parcel.writeString(data);
    }
}
